export const dragImgMove = function (e) {
    e.preventDefault();
    e.stopPropagation()
    let box = e.target
    let disX = e.clientX - box.offsetLeft;
    let disY = e.clientY - box.offsetTop;
    let parentBox = e.target.offsetParent
    document.onmousemove = function (event) {
        let x = event.clientX - disX;
        let y = event.clientY - disY;
        box.style.position = "absolute";
        box.style.left = x + "px";
        box.style.top = y + "px";
    }
    parentBox.onmouseleave = function () {
        document.onmousemove = null;
    }
    document.onmouseup = function () {
        document.onmousemove = null;
    }
};
export const removeDrag = function (e) {
    document.onmouseup = function () {
        document.onmousemove = null;
    }
};